﻿using System;
using Business;

public partial class Pages_Personal : Business.Security.AdminPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session.Count != 0) return;
        Response.Redirect(Config.ApplicationUrl + "authen.html");
    }
    protected void Page_Init(object sender, EventArgs e)
    {
        if (Session.Count == 0)
        {
            Session.Abandon();
            Response.Redirect(Config.ApplicationUrl + "authen.html");
        }
        try
        {
            LoadControl();

        }
        catch (Exception ex)
        {
            Config.WriteLog(ex.Message + Environment.NewLine + ex.StackTrace);
            ltrError.Text = ex.Message;
            MultiView1.SetActiveView(ViewError);
            Config.Message(Page, "Có lỗi trong quá trình xử lý", "Thông báo lỗi");
        }
    }
    private void LoadControl()
    {
        Page.Title = @"Hệ thống quản trị - Setting ";
        var usercontrol = LoadControl("~/Controls/Backend/Profile.ascx");
        Session[SessionManager.SessionUserControl] = usercontrol;
        Content.Controls.Add(usercontrol);
        MultiView1.SetActiveView(ViewControl);


    }
}